import 'element-plus/es/components/loading/style/css'
import {ElLoading} from 'element-plus'

// 安装 按需引入情况下支持 $loading方法
const ElementPlusLoading = {
  install: (app) => {
    app.config.globalProperties.$loading = (text) => {
      return ElLoading.service({
        fullscreen: true,
        lock: true,
        text: text,
        background: 'rgba(0, 0, 0, 0.5)'
      })
    }
  }
}

export default ElementPlusLoading